﻿define('api/emissionService', [], function() {
	return {
		getCityAggregationEmission:function(param){
			var _data;
			ajaxProcess({
	            url : '/pls/gis/emission/polyList',
	            requestType : 'POST',
	            async:false,
	            data : {
	            	arealevel:'2',
	            	areacode:'',
	            	pareacode:'',
	            	year:'',
	            	pollutecode:''
	            },
	            successHandle : function(data) {
	            	console.log(data);
	            	_data = data;
	            }
	        });
			return _data;
		},
		
		getAreaAggregationEmission:function(param){
			var _data;
			ajaxProcess({
	            url : '/pls/gis/emission/polyList',
	            requestType : 'POST',
	            async:false,
	            data : {
	            	arealevel:'3',
	            	areacode:'',
	            	pareacode:'',
	            	year:'',
	            	pollutecode:''
	            },
	            successHandle : function(data) {
	            	_data = data;
	            }
	        });
			return _data;
		},
		
		getEmissionRankByCity:function(param, callback){
			ajaxProcess({
	            url : '/pls/gis/emission/polyRankList',
	            requestType : 'POST',
	            data : {
	            	arealevel:'2',
	            	areacode:'',
	            	pareacode:'',
	            	year:'',
	            	pollutecode:'',
	            	permitactual:'1'    
	            },
	            successHandle : function(data) {
	            	if(callback && typeof callback === 'function') {
	            		callback(data);
	            	}
	            }
	        });
		},
		
		getEmissionRankByArea: function(param, callback){
			ajaxProcess({
	            url : '/pls/gis/emission/polyRankList',
	            requestType : 'POST',
	            data : {
	            	arealevel:'3',
	            	areacode:'',
	            	pareacode:'',
	            	year:'',
	            	pollutecode:'',
	            	permitactual:'1'
	            },
	            successHandle : function(data) {
	            	if(callback && typeof callback === 'function') {
	            		callback(data);
	            	}
	            }
	        });
		},
		
		getEmissionRankByEnterprise: function(param, callback){
			ajaxProcess({
	            url : '/pls/gis/emission/multiPointRankList',
	            requestType : 'POST',
	            data : {
	            	arealevel:'',
	            	areacode:'',
	            	pareacode:'',
	            	year:'',
	            	pollutecode:'',
	            	permitactual:'1'
	            },
	            successHandle : function(data) {
	            	if(callback && typeof callback === 'function') {
	            		callback(data);
	            	}
	            }
	        });
		}
	};
	
});
